package com.wtwd.campus.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.wtwd.campus.entity.LocationSubmeter;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author mjy
 * @date 2022/11/24
 * @description
 */
@Mapper
public interface LocationSubmeterMapper extends BaseMapper<LocationSubmeter> {


    Integer save(@Param("tableName") String tableName, @Param("locationSubmeter") LocationSubmeter locationSubmeter);

    List<LocationSubmeter> queryLocationSubmeterByDeviceIdAndTime(@Param("tableName") String tableName, @Param("deviceId") Integer deviceId, @Param("startTime") long startTime, @Param("endTime") long endTime);

    int clearLocationDataByTimeAndTableName(@Param("time") long time, @Param("tableName") String tableName);

    IPage<LocationSubmeter> queryDeviceLocationPage(@Param("tableName") String tableName, @Param("deviceId") Integer deviceId, @Param("page") Page<LocationSubmeter> page);
}
